<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');
?>

<h1>Add Instructor</h1>
<?php
//get num_rows currently in instructor table
$instructor_fname = mysql_real_escape_string(strip_tags($_POST['fname']));
$instructor_lname = mysql_real_escape_string(strip_tags($_POST['lname']));

$query = "INSERT INTO instructors (id, first_name, last_name)
VALUES
('','$instructor_fname','$instructor_lname')";

$result = mysql_query($query);

if ($result)
{
	echo "<b>".stripslashes($instructor_fname)." ".stripslashes($instructor_lname)."</b> has been successfully added!";
	echo "<br />";
}
else
{
	echo "<b>".stripslashes($instructor_fname)." ".stripslashes($instructor_lname)."</b> was NOT able to be added at this time!";
	echo "<br />";
}

//close
mysql_close();

?>

<p>
	<a href="index.php">&lt;&lt; Back to Instructors Portal</a><br />
</p>

<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>